package com.lanyou.esb.redis.proxy.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.lanyou.esb.common.CommonUtils;
import com.lanyou.esb.common.Constants4Redis;
import com.lanyou.esb.redis.proxy.base.BaseHashJedisProxy;
import com.lanyou.esb.redis.vo.FieldSystemVo;

/**
 * 领域系统Redis操作代理
 * 
 * @author Davey.wu
 */
@Service
public class FieldSystemJedisProxy extends BaseHashJedisProxy<FieldSystemVo> {

	public FieldSystemJedisProxy() {
		this.setHashKey(Constants4Redis.REDIS_HASH_KEY_FS);
		/** field的组成：系统编码 **/
		Map<String, Integer> keyFields = new HashMap<>();
		keyFields.put(CommonUtils.SYSTEM_CODE, 0);
		this.setKeyFields(keyFields);
	}

	@Override
	public Map<String, String> getKeyMap(FieldSystemVo fieldSystem) {
		Map<String, String> map = new HashMap<>(4);
		map.put(CommonUtils.SYSTEM_CODE, fieldSystem.getCode());
		return map;
	}

}
